package com.myCinema.dao.impl;

import java.util.List;

import org.hibernate.Session;

import com.myCinema.dao.CategoryDao;
import com.myCinema.dao.HibernateUtil;
import com.myCinema.entity.Category;

public class CategoryDaoImpl implements CategoryDao {

	public List<Category> getAll() {
		Session sess = null;
		try{
			sess = HibernateUtil.openSession();
			return sess.createQuery("from Category").list();
		}finally{
			sess.close();
		}
	}
	
	public static void main(String[] args) {
		
	}

}
